#include<stdio.h>
#include<string.h>

int removeDuplicates(int *nums,int numSize,int *newSize)
{
     int pos = 1;
     for(int idx = 1;idx < numSize;idx++)
     {
        if(nums[idx] != nums[idx - 1])
        {
          nums[pos++] = nums[idx];
        }
        
     }
     *newSize = pos;
     return 0;
}
int main()
{
    int nums[] = {0,0,1,1,1,2,2,2,2,2,3,3,4};

    int size = 0;

    removeDuplicates(nums,sizeof(nums)/sizeof(nums[0]),&size);

    for(int idx = 0;idx < size;idx++)
    {
        printf("nums[%d] = %d\n",idx,nums[idx]);
    }

    return 0;

}